package com.slunk.accessors;

import aurelienribon.tweenengine.TweenAccessor;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.g2d.BitmapFont;

public class BitmapFontAccessor implements TweenAccessor<BitmapFont>{
	public static final int FADE = 1;
	
	@Override
	public int getValues(BitmapFont arg0, int arg1, float[] arg2) {
		switch (arg1) {
	        case FADE:
	        	arg2[0] = arg0.getColor().a;
	        	return 1;
	    }
		return -1;
	}

	@Override
	public void setValues(BitmapFont arg0, int arg1, float[] arg2) {
		// TODO Auto-generated method stub
		switch (arg1) {
	        case FADE: 
	        	Color oldColor = arg0.getColor();
	        	Color transformedColor = new Color(oldColor.r,oldColor.g,oldColor.b,arg2[0]);
	        	arg0.setColor(transformedColor);
	        	break;
	        default: assert false; break;
		}
	}
}
